package com.design.pattern.abstractfactory;

import com.design.pattern.abstractfactory.factory.BusinessFactory;
import com.design.pattern.abstractfactory.factory.Factory;
import com.design.pattern.abstractfactory.factory.SportFactory;
import com.design.pattern.abstractfactory.product.BenZ;

/**
 * Created by Administrator on 2016/5/17.
 */
public class BossAbstractFactory {
    public static void main(String[] args) {
        //我需要一个生产商务车的工厂
        System.out.println("我需要一个生产商务车的工厂");
        Factory businessFactory = new BusinessFactory();
        //我需要一辆奔驰的商务车
        System.out.println("我需要一辆奔驰的商务车");
        BenZ benZBuss = businessFactory.createBenZ("BenZ s600");
        benZBuss.drive();

        //我需要一个生产运动型汽车的工厂
        System.out.println("我需要一个生产运动型汽车的工厂");
        Factory sportFactory = new SportFactory();
        //我需要一辆奔驰的商务车
        System.out.println("我需要一辆奔驰的商务车");
        BenZ benZSport = sportFactory.createBenZ("BenZ B300");
        benZSport.drive();
    }
}
